// DriveNotes. Copyright (c) 2011, Andrei Senchuk. All rights reserved.
package net.taviscaron.drivenotes.server.service.endpoint;

import java.util.TreeMap;
import javax.jws.WebMethod;
import javax.jws.WebService;
import net.taviscaron.drivenotes.shared.model.entity.Car;
import net.taviscaron.drivenotes.shared.service.StatisticService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Statistic service impl
 * @author Andrei Senchuk
 */
@WebService(serviceName = "StatisticService")
public class StatisticServiceEndpoint implements StatisticService {
    @Autowired
    private StatisticService statisticService;

    @WebMethod
    public Float calculateTotalServiceCost(Car car) {
        return statisticService.calculateTotalServiceCost(car);
    }

    @WebMethod
    public Float calculateTotalChargingCost(Car car) {
        return statisticService.calculateTotalChargingCost(car);
    }

    @WebMethod
    public TreeMap<Integer, Double> calculateFuelConsumptionTendention(Car car) {
        return statisticService.calculateFuelConsumptionTendention(car);
    }
}
